package secondStage.part2.接口.three;

/**
 * @ClassName: [AnimalDemo]
 * @Description: 猫狗j接口案例
 * @Author: [黄劲松]
 * @CreateDate: [2021-03-14]
 * @Version: [v1.0]
 */
public class AnimalDemo {
    public static void main(String[] args) {
        Jumpping j = new Cat();
        j.jump();
        System.out.println("-------------");

        Animal a = new Cat();
        a.setName("加菲猫");
        a.setAge(4);
        System.out.println(a.getName() + "," + a.getAge());
        a.eat();
        a = new Cat("汤姆", 5);
        System.out.println(a.getName() + "," + a.getAge());
        a.eat();
        System.out.println("--------------");

        Animal a1 = new Dog();
        a1.setName("格里芬");
        a1.setAge(4);
        System.out.println(a1.getName() + "," + a1.getAge());
        a1.eat();
        a1 = new Cat("苏格兰牧羊犬", 5);
        System.out.println(a1.getName() + "," + a1.getAge());
        a1.eat();

        Cat c = new Cat();
        c.setName("你好");
        c.setAge(9);
        System.out.println(c.getName() + "," + c.getAge());
        c.eat();
        c.jump();
    }
}
